Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle compilation exiting #514

Merged
merged 5 commits into from
Dec 12, 2023
Merged

Handle compilation exiting #514

merged 5 commits into from
Dec 12, 2023

Conversation

scohen
Copy link
Collaborator

@scohen scohen commented Dec 12, 2023

It is possible for compilation to exit, and we were not handling it properly. This was complicated by the fact that builds happen inside a GenServer, so wrapping things in a try/rescue with an exit handler wasn't enough.

Instead, i launched another process that's monitored and awaited by the build genserver. Then any DOWN messages are turned into diagnostics, and reported.

Fixes #504

It is possible for compilation to exit, and we were not handling it
properly. This was complicated by the fact that builds happen inside a
GenServer, so wrapping things in a try/rescue with an exit handler
wasn't enough.

Instead, i launched another process that's monitored and awaited by
the build genserver. Then any DOWN messages are turned into
diagnostics, and reported.

Fixes #504
@zachallaun
Copy link
Collaborator

Obviously look into the test errors but the strategy looks good to me.

Implemented some of the PR suggestions, and increased the global
timeout for assert_receive to 1 second to see if that fixes errors in CI
  * Excluded a test that relied on elixir >= 1.14.0 on elixir 1.13
  * Used Process.demonitor rather than a receive block to flush down message
@scohen scohen merged commit a32fcfe into main Dec 12, 2023
7 checks passed
@scohen scohen deleted the extra-build-resilience branch December 12, 2023 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lexical Build crashes if the compiler exits
2 participants